package com.bs.mapper;

import java.util.*;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.bs.bean.Detail;
import com.bs.bean.Orders;
import com.bs.utils.DBUtils;
public interface DetailMapper {
//	定义表名
	public static final String table="detail";

//  查询detail表中的所有数据
	@Select("select * from "+DBUtils.perfix+table+DBUtils.sufix+"")
	List<Detail> selectByExample(Detail detail);
	
//  根据主键id查询detail表中对应的数据
	@Select("select * from "+DBUtils.perfix+table+DBUtils.sufix+" where "+DBUtils.perfix+"id"+DBUtils.sufix+"=#{id}")
	Detail selectByPrimaryKey(Integer id);
	
//  向detail表中的添加一条数据
	@Insert("insert into "+DBUtils.perfix+table+DBUtils.sufix+" values(#{id},#{detailcontent})")
	int insertSelective(Detail detail);
	
//  根据主键id删除detail表中对应的数据
	@Delete("delete from "+DBUtils.perfix+table+DBUtils.sufix+" where "+DBUtils.perfix+"id"+DBUtils.sufix+"=#{id}")
	int deleteByPrimaryKey(Integer id);

}
